import React, {Component} from 'react';
import './App.css';
import 'element-theme-default'
import {LogIn} from "./api/api"
import {instance} from "./api/base"
import LogInPage from "./view/page/LogInPage"
import HomePage from "./view/page/HomePage"

import {Switch, Route} from 'react-router-dom'

class App extends Component {
    render() {
        return (
            <div className="App">
                <Switch>
                    <Route exact path='/' component={HomePage}/>
                    <Route path='/LogIn' component={LogInPage}/>
                </Switch>
            </div>
        );
    }

    Logincrease() {
        LogIn({password: 123456, time: 60, administrator_id: 'root'}).then(x => {
            console.log(x, 999999999);
            instance.defaults.headers.token = x.result.token;
            window.localStorage.setItem('token', x.result.token)
        }).catch(x => {
            console.log(x)
        })
    }
}

export default App;
